﻿using System.Globalization;
using System.Windows.Data;

namespace TianlalaHSB.ViewModels;

public class CdFlagConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value is string)
            return value switch
            {
                "D" => "借",
                "C" => "贷",
                _ => ""
            };
        return "";
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        // 如果需要双向转换，这里实现转换回bool的逻辑
        throw new NotImplementedException();
    }
}